Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DSDK-80] Define project structure (file tree) #2

Merged
merged 24 commits into from
Jan 17, 2024

Conversation

jdabbech-ledger
Copy link
Contributor

@jdabbech-ledger jdabbech-ledger commented Dec 15, 2023

πŸ“ Description

Setup project structure
Add sample app & packages with turborepo

❓ Context

βœ… Checklist

Pull Requests must pass the CI and be code reviewed. Set as Draft if the PR is not ready.

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • setup turborepo with sample apps and packages @ledgerhq/device-sdk-core @ledgerhq/device-sdk-signer @ledgerhq/device-sdk-trustap-apps @ledgerhq/device-sdk-ui
    • packages/cores/script/add-feature.mjs script to create folders of a new feature in ledgerhq/device-sdk-core.
    • setup sample app with create-next-app
    • setup packages folder structure:
packages
β”œβ”€β”€ config
β”‚Β Β  β”œβ”€β”€ eslint
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ index.js
β”‚Β Β  |   β”œβ”€β”€ package.json // @ledgerhq/eslint-config-dsdk
|   β”œβ”€β”€ typescript
|   β”‚Β Β  β”œβ”€β”€ package.json // @ledgerhq/tsconfig-dsdk
|   β”‚Β Β  β”œβ”€β”€ sdk.json
|   β”‚Β Β  └── web.json
β”œβ”€β”€ core
β”‚Β Β  β”œβ”€β”€ package.json // @ledgerhq/device-sdk-core
β”‚Β Β  β”œβ”€β”€ scripts
β”‚Β Β  β”‚Β Β  └── add-feature.mjs
β”‚Β Β  β”œβ”€β”€ src
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ api
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ common
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ device-action
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ shared
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ entities
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── utils
β”‚Β Β  β”‚Β Β  └── transport
β”‚Β Β  └── tests
β”œβ”€β”€ signer
β”‚Β Β  β”œβ”€β”€ package.json // @ledgerhq/device-sdk-signer
β”‚Β Β  β”œβ”€β”€ src
β”‚Β Β  └── tests
β”œβ”€β”€ trusted-apps
β”‚Β Β  β”œβ”€β”€ package.json // @ledgerhq/device-sdk-trustap-apps
β”‚Β Β  β”œβ”€β”€ src
β”‚Β Β  └── tests
└── ui
    β”œβ”€β”€ package.json // @ledgerhq/device-sdk-ui
    β”œβ”€β”€ src
    └── tests

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

@jdabbech-ledger jdabbech-ledger force-pushed the feature/DSDK-80-setup-file-structure branch from d1f8ae2 to 551ec87 Compare December 18, 2023 12:30
@jdabbech-ledger jdabbech-ledger changed the base branch from main to develop December 18, 2023 15:55
Copy link
Member

@mbertin-ledger mbertin-ledger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could handle the retun live :)

.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
.github/workflows/main.yml Outdated Show resolved Hide resolved
apps/sample/src/App.tsx Outdated Show resolved Hide resolved
packages/core/scripts/add-feature.mjs Outdated Show resolved Hide resolved
packages/core/src/api/DeviceSdk.ts Outdated Show resolved Hide resolved
"persistent": true
}
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As describe above for github actions.
We could define here, pull_request_develop entry here for pipelines

Copy link
Contributor Author

@jdabbech-ledger jdabbech-ledger Dec 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like a test entry that depends on build & lint and execute test in each packages? I guess a naming pull_request should only designate a git workflow step

@jdabbech-ledger jdabbech-ledger force-pushed the feature/DSDK-80-setup-file-structure branch 9 times, most recently from a7d99f0 to ebfb252 Compare December 20, 2023 10:32
@jdabbech-ledger jdabbech-ledger force-pushed the feature/DSDK-80-setup-file-structure branch from 95d8bd0 to d70dafb Compare December 27, 2023 11:58
packages/core/.eslintrc.js Show resolved Hide resolved
@jdabbech-ledger jdabbech-ledger force-pushed the feature/DSDK-80-setup-file-structure branch from ded522b to 6e0586a Compare January 2, 2024 16:53
@jdabbech-ledger jdabbech-ledger changed the base branch from develop to main January 2, 2024 17:37
@jdabbech-ledger jdabbech-ledger changed the base branch from main to develop January 2, 2024 17:37
@jdabbech-ledger jdabbech-ledger force-pushed the feature/DSDK-80-setup-file-structure branch from a3453c1 to a0073ed Compare January 3, 2024 15:39
.gitignore Show resolved Hide resolved
packages/core/.eslintrc.js Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
.github/workflows/pull_request.yml Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
packages/config/eslint/package.json Outdated Show resolved Hide resolved
packages/core/scripts/add-feature.mjs Outdated Show resolved Hide resolved
packages/core/src/transport/Transport.ts Show resolved Hide resolved
packages/core/src/transport/model/Response.ts Outdated Show resolved Hide resolved
"dev": "tsc --watch",
"lint": "eslint --cache --ext .ts \"src\"",
"lint:fix": "eslint --cache --fix --ext .ts \"src\"",
"feature": "zx scripts/add-feature.mjs",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[COULD] could you maybe document this script in the README.md ? (the other ones are pretty classic so not needed I think)

Copy link
Contributor

@ofreyssinet-ledger ofreyssinet-ledger Jan 4, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this script seems like a nice addition πŸ‘

Copy link
Contributor

@ofreyssinet-ledger ofreyssinet-ledger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great job overall! lgtm πŸ‘
maybe a small readme in explaining how to setup the project, its structure, the different packages, explaining the main commands, explaining the dependencies (node version for instance) would be nice. But it can also be done as a separate task I think, this is already a lot πŸ‘

@aussedatlo
Copy link
Contributor

lgtm πŸ‘

@jdabbech-ledger jdabbech-ledger force-pushed the feature/DSDK-80-setup-file-structure branch 3 times, most recently from 5ea0006 to 7d30cc5 Compare January 16, 2024 14:37
@jdabbech-ledger jdabbech-ledger force-pushed the feature/DSDK-80-setup-file-structure branch from 481012a to 2c443d1 Compare January 17, 2024 08:01
"extends": "@tsconfig/recommended/tsconfig.json",
"compilerOptions": {
"target": "esnext",
"lib": ["esnext", "dom"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need dom ? Maybe if we have a package that export React hooks wrapping our action maybe ?

Copy link
Contributor Author

@jdabbech-ledger jdabbech-ledger Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this in order to allow the usage of console in DSDK ts

await $`touch entities/.gitkeep data/.gitkeep use-cases/.gitkeep repository/.gitkeep`;
});
}
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice :)

@jdabbech-ledger jdabbech-ledger merged commit 9a6ae56 into develop Jan 17, 2024
2 checks passed
@jdabbech-ledger jdabbech-ledger deleted the feature/DSDK-80-setup-file-structure branch January 17, 2024 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants